/**
  ******************************************************************************
  * @file    PmsmDrvParam.h
  * @author  Silan - MC Team
  * @version 1.0.0
  * @date    2017/08/14
  * @brief   PMSM Driver Parameter Header File
  * @details None
  * @note    None
  ******************************************************************************
  * @attention
  * THE PRESENT SOFTWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
  * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
  * AS A RESULT, SILAN MICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT,
  * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE
  * CONTENT OF SUCH SOFTWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING
  * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
  *
  ******************************************************************************
  * Change History
  * -# 2017/08/14 | v1.0.0 | Wangjianlong | Creat file.
  *
  *
  *
  *
  *
  *
  *
  *
  *
  ******************************************************************************
  */

/*******************************************************************************
 * Define to prevent recursive inclusion
 ******************************************************************************/
#ifndef __PMSM_DRV_PARAM_H__
#define __PMSM_DRV_PARAM_H__


/*******************************************************************************
 * Include section
 ******************************************************************************/
#include "stdint.h"

/*******************************************************************************
 * Typedefs, structs and enums
 ******************************************************************************/

/**
  * @brief PMSM driver parameters structure definition
  */
struct PMSM_DRV_PARAM_s{
  uint16_t  u16PwmFreq;
  float     fPwmDtUS;
  float     fSmpDelay;
  uint8_t   u8PolePairs;
  float     fRs;
  float     fLd;
  float     fLq;
  float     fJ;
  float     fFlux;
  uint8_t   u8BaseFreqMec;
  float     fBaseCurr;
  uint16_t  u16BaseVolt;
  uint8_t   u8OverModeEn;
  uint8_t   u8SingleShuntEn;
  float     fDampedCoeff4SpdPI;
  float     fBandWidth4SpdPI;
  float     fDampedCoeff4SpdComp;
  float     fBandWidth4SpdComp;
  uint16_t  u16BandWidth4CurrPI;
  float     fDampedCoeff4PllPI;
  uint8_t   u8BandWidth4PllPI;
  uint8_t   u8FilterCoeff4Spd;
  uint8_t   u8Kp4WF;
  uint8_t   u8Ki4WF;
  uint8_t   u8SpdVal4MTPA;
  uint8_t   u8TorqueCompFreq;
  float     fTorqueCompPeakCurr;
  float     fFieldWeekPoint;
  float     fFieldWeekLimitId;
  uint8_t   u8ResonancePointVal;
  uint8_t   u8AntiResonanceBandWidth;
  uint8_t   u8ResonancePointVal1;
  uint8_t   u8AntiResonanceBandWidth1;
  float     fAccRampVal;
  float     fDecRampVal;
  float     fMaxSpeedPU;
  float     fMinSpeedPU;
  float     fOCVal4RMS;
  uint8_t   u8OCVal4Peak;
  uint8_t   u8Omega4PhaseLost;
  float     fCurr4PhaseLack;
  float     fMaxIsVal;
  float     fStartupCurr;
  uint8_t   u8StartupOmega;
  uint8_t   u8StartupRmpAcc;
  uint8_t   u8RateCurr;
  uint8_t   u8Curr1;
  uint8_t   u8Curr2;
  float     fLdPercent1;
  float     fLqPercent1;
  float     fLdPercent2;
  float     fLqPercent2;
  float     fStartupHeatCurrPU;
  uint8_t   u8ChkOmega;
  uint8_t   u8ChkVolt;
  float     fMinPulse;
};

/*******************************************************************************
 * Prototypes of the functions
 ******************************************************************************/
extern void PmsmDrvParamDefault(struct PMSM_DRV_PARAM_s *ptr);

#endif /* __PMSM_DRV_PARAM_H__ */
/*---------------------------------- End of the file ---------------------------------*/

